import request from '@/request'
const URL = process.env.VUE_APP_API

// 获取角色列表数据
export function getRoleList(data) {
  return request({
    url: `${URL}/manage/upms/role/search`,
    method: 'post',
    data
  })
}
// 新增角色
export function addRole(data) {
  return request({
    url: `${URL}/manage/upms/role/add`,
    method: 'post',
    data
  })
}
// 编辑角色
export function updateRole(data) {
  return request({
    url: `${URL}/manage/upms/role/update`,
    method: 'post',
    data
  })
}
// 删除角色列表
export function deleteRole(data) {
  return request({
    url: `${URL}/manage/upms/role/delete?id=${data}`,
    method: 'post'
  })
}
// 角色详情
export function getRoleInfo(params) {
  return request({
    url: `${URL}/manage/upms/role/detail`,
    method: 'get',
    params
  })
}
// 禁用角色接口
export function lockRole(id) {
  return request({
    url: `${URL}/manage/upms/role/lock?id=${id}`,
    method: 'post'
  })
}
// 启用角色接口
export function unlockRole(id) {
  return request({
    url: `${URL}/manage/upms/role/unlock?id=${id}`,
    method: 'post'
  })
}
